package com.zhuhjay.common.security.context;

import com.zhuhjay.common.base.enums.HttpCode;

/**
 * 认证异常上下文
 * @author ZhuHJay
 * @date 2023/4/24 14:14
 */
public class AuthenticationExceptionContext {

    private static final ThreadLocal<HttpCode> CONTEXT = new ThreadLocal<>();

    public static void setCode(HttpCode httpCode) {
        CONTEXT.set(httpCode);
    }

    public static HttpCode getCode() {
        return CONTEXT.get();
    }

    public static void clear() {
        CONTEXT.remove();
    }

}
